package com.runshu.newsmartark.entity;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;
import java.util.List;

/**
 * Demo class
 *
 * @author yu
 * @date 2020/11/5
 * @decs：
 */

public class NewTakeStockEntity implements Parcelable {
    private String stock;

    public List<ProductsBean> getList() {
        if (list == null) {
            return new ArrayList<>();
        }
        return list;
    }

    public void setList(List<ProductsBean> list) {
        this.list = list;
    }

    private List<ProductsBean> list;

    public String getStock() {
        return stock == null ? "" : stock;
    }

    public void setStock(String stock) {
        this.stock = stock == null ? "" : stock;
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.stock);
        dest.writeTypedList(this.list);
    }

    public NewTakeStockEntity() {
    }

    protected NewTakeStockEntity(Parcel in) {
        this.stock = in.readString();
        this.list = in.createTypedArrayList(ProductsBean.CREATOR);
    }

    public static final Parcelable.Creator<NewTakeStockEntity> CREATOR = new Parcelable.Creator<NewTakeStockEntity>() {
        @Override
        public NewTakeStockEntity createFromParcel(Parcel source) {
            return new NewTakeStockEntity(source);
        }

        @Override
        public NewTakeStockEntity[] newArray(int size) {
            return new NewTakeStockEntity[size];
        }
    };
}